home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / programm.ing / sources.arc / DANG_SRC.LZH / GLOBALS2.H < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-13  |  7.4 KB  |  267 lines

  1.  
  2. /* globals.h            - Contains all the external variables 
  3.                          Its to be used with all the other modules 
  4.                          Jan 24,1992 Jeff Bilger                */
  5.  
  6.  
  7. /* extern ->> Just declares the var, it does NOT allocate storage */
  8.  
  9.  
  10. extern    long    bios();
  11. extern    long    xbios();
  12. extern    long    gemdos();
  13.  
  14. #define    Dosound(a)    xbios(32,a)
  15. #define Vsync()        xbios(37)
  16. #define    Random()    (int)xbios(17)         /* int so we can use % */
  17. #define    Bconin(a)    bios(2,a)
  18. #define    Setcolor(a,b)    (int)xbios(7,a,b)
  19. #define    Pexec(a,b,c,d)    gemdos(0x4b,a,b,c,d)
  20.  
  21. #define pos_rnd(t) abs(Random()%(t))   /*returns a number from 0 to (t-1) */
  22.  
  23. #define CH_A_TONE_L     0x00,   /* TONE PERIOD REGS. determines pitch*/  
  24. #define CH_A_TONE_H     0x01,   /* period = 125,000 / freq (Hz) */
  25. #define CH_B_TONE_L     0x02,   /* see page 76 Atari ST TOS */
  26. #define CH_B_TONE_H     0x03,
  27. #define CH_C_TONE_L     0x04,
  28. #define CH_C_TONE_H     0x05,
  29. #define NOISE_PERIOD    0x06,    /* LOW = Thin,static like HIGH = fast rushing (windlike) */
  30. #define ENAB_TONE_NOISE 0x07,    
  31. #define CH_A_VOL_AMP    0x08,
  32. #define CH_B_VOL_AMP    0x09,
  33. #define CH_C_VOL_AMP    0x0a,
  34. #define ENV_PERIOD_L    0x0b,    /* Higher period = more slowly VOL changes and TONES are bell like*/
  35. #define ENV_PERIOD_H    0x0c,    /* lower period  = VOL changes fast and TONES are very raspy! */
  36. #define WAVEFORM        0x0d,    
  37. #define PLACE           0x80,    /* For Ending, or loops */
  38. #define INTO            0x81,
  39. #define INCREMENT_BY
  40. #define UNTIL
  41.  
  42.  
  43. #define WHITE 0
  44. #define BLACK 3
  45. #define GREEN 2
  46. #define RED   1
  47. #define MAX   13
  48. #define MIN   0
  49. #define HOUR_VALUE 750        /* set this to change dT */
  50. #define rnd(t) (abs(Random()%(t)))   /*returns a number from 0 to (t-1) */
  51.  
  52. typedef struct fdbstr
  53. {
  54.     long    fd_addr;
  55.     int        fd_w;
  56.     int        fd_h;
  57.     int        fd_wdwidth;
  58.     int        fd_stand;
  59.     int        fd_nplanes;
  60.     int        fd_r1;
  61.     int        fd_r2;
  62.     int        fd_r3;
  63. } MFDB;    
  64.  
  65. extern  int     pal2[],pal3[],pal4[];
  66.  
  67.  
  68. extern int weather; /* holds 0-6, used as index [7] as max*/
  69.  
  70. extern int count; /* for time */
  71. extern int way;      /* for time */
  72. extern int change[]; /* for dynamic sky */
  73. long time;         /* for time keeping */
  74. extern char string[30];
  75.  
  76. /*misc declarations*/
  77.  
  78. extern int runner;
  79. extern int hrt[20];  /*0-19 the hit roll table allocation */
  80. extern int mhrt[20];  /*0-19 the hrt for monsters */
  81.  
  82. extern struct mon_
  83.         {
  84.         char name[20];  /* this is bad, make it a char *name; not*/
  85.         int ac;          /* char *name[20]! This creates an array */
  86.         int hd;          /* of 20 ptrs to type CHAR */
  87.         int hp;
  88.         int weapon;
  89.         int spell;
  90.         int lvl;
  91.         };
  92.  
  93. extern struct mon_ mon;  /* storage for the data of the monster you are fighting*/
  94.  
  95. extern struct mon_ monsters[51]; /* 51, or 0 to 50!!! */
  96.  
  97.   /* stores the monsters, its an array of records!*/
  98.   /* to access hp. --->  MONSTERs[2].hp = xxx; */
  99.  
  100.  
  101.  
  102.  
  103. extern struct character
  104.         {
  105.          char name[15]; /* NO! Set these to char *name and then */
  106.          char align[15]; /* name = "blahh.." OR do char name[]="blah!" */
  107.          char class[15];  /* you're defining an array of one element */
  108.          int lvl;         /* thats a ptr to a char! too redundant! */
  109.          long int exp;
  110.          long int hp;
  111.          int ac,str,inte,wis,dex,con;
  112.          int weapon_num,armor_num;
  113.          int backpack[10];       /* holds unique #. I'll have 1 main array that will hold number,name so we can look it up */
  114.          char weapon[15];
  115.          char armor[15];
  116.          char spell[15];
  117.          long int max_hp,max_sp;
  118.          int spell_num;
  119.          long int sp;
  120.          long int gold;
  121.          int user_items[25];  /* holds food,h2o,keys,etc.. */
  122.          int current_spells_active[5]; /*0=treasure Finding, 1=Fleetness, 2=Protection
  123.                                          3=Strength 4=Charm */
  124.          int hunger_thurst_status[2];  /*0 not hungry/thirsty.. 10 FAMISHED */
  125.                                        /* 0 is hunger 1 is thirst */
  126.          long int bank_balance;  
  127.          int x_loc,y_loc,        /* current x,y location */
  128.              weather,count,way,time,loc,current_sky,
  129.              current_sound,clock,am_pm,sound;
  130.          char dir; 
  131.          };
  132.  
  133. extern struct character user;
  134.  
  135.    
  136. extern int who_goes,mon_alive,char_alive,mon_num,mon_lvl;
  137.  
  138.  
  139. extern char n[];
  140. extern char null[2] ;
  141. extern int savepal[16],newpal[16],junkbuff[46];
  142.  
  143. extern int handle;     /*  Virtual Workstation*/
  144.  
  145.  
  146. extern int contrl[12];
  147. extern int intin[256],  ptsin[256];
  148. extern int intout[256], ptsout[256];
  149.  
  150.  
  151.  
  152. extern char dir;
  153. extern   int x;
  154. extern   int y;
  155. extern   int loc;   
  156. extern   char command;    
  157. extern   int mssg_count;
  158.     
  159.    /* back pack lookup data structs */
  160. extern struct i_look
  161.        {
  162.         char name[15];
  163.         int points;
  164.        }unique_item[];
  165.  
  166. /* sound invokage */
  167. extern long addr;      /* points to addr that player is stored at */
  168.  
  169.  
  170. extern int CURRENT_CLOUD;
  171. extern int CURRENT_SKY;       /* holds current value of sky color */
  172. extern int CURRENT_SOUND;     /* if 1-wind, 4-Rain, else no sound */
  173.  
  174. /* GLOBAL SOUNDS FOR DOSOUND() */
  175.  
  176. static unsigned char wind_sound[]={
  177. CH_A_VOL_AMP     0x0b,
  178. CH_B_VOL_AMP     0x11,
  179. CH_C_VOL_AMP     0x03,
  180. CH_A_TONE_H      0x01,
  181. CH_A_TONE_L      0xff,
  182. CH_B_TONE_H      0xff,
  183. CH_B_TONE_L      0xff,
  184. NOISE_PERIOD     0xff,
  185. ENAB_TONE_NOISE  0x03,
  186. ENV_PERIOD_L     0x22,
  187. ENV_PERIOD_H     0xff,
  188. WAVEFORM         0x0e,                         
  189. PLACE 0x02,INTO 0x12, INCREMENT_BY 0x02, UNTIL 0x25};
  190.  
  191. static unsigned char quiet[] = {
  192. CH_A_VOL_AMP     0x00,
  193. CH_B_VOL_AMP     0x00,
  194. CH_C_VOL_AMP     0x00,
  195. CH_A_TONE_H      0x00,
  196. CH_A_TONE_L      0x00,
  197. CH_B_TONE_H      0x00,
  198. CH_B_TONE_L      0x00,
  199. NOISE_PERIOD     0x00,
  200. ENAB_TONE_NOISE  0x00,
  201. ENV_PERIOD_L     0xff,
  202. ENV_PERIOD_H     0xff,
  203. WAVEFORM         0x00,  
  204. 0xff,0x00};
  205.     
  206.  
  207. static unsigned char rain_sound[]={
  208. CH_A_VOL_AMP     0xff,
  209. CH_B_VOL_AMP     0xff,
  210. CH_C_VOL_AMP     0x03,
  211. CH_A_TONE_H      0xff,
  212. CH_A_TONE_L      0x00,
  213. CH_B_TONE_H      0xff,
  214. CH_B_TONE_L      0x00,
  215. CH_C_TONE_H      0x09,
  216. CH_C_TONE_L      0x00,
  217. NOISE_PERIOD     0xff,
  218. ENAB_TONE_NOISE  0x63,
  219. ENV_PERIOD_L     0x22,
  220. ENV_PERIOD_H     0x11,
  221. WAVEFORM         0x0d,                         
  222. PLACE 0x02,INTO 0x12, INCREMENT_BY 0x02, UNTIL 0x25};
  223.  
  224. /* SOME TIME DEFS */ /* Initial time is 1pm in the afternoon */
  225. extern int clock;   /* when == 12 a clock tolls , also tells time of day */
  226. extern int am_pm;   /* if == 1 then its pm. at midnight change to am, at noon change to pm */
  227.  
  228. extern int cell; /* room you are in */
  229.  
  230. extern struct field_data
  231.     {
  232.     int Field1,
  233.         Field2,
  234.         Field3,
  235.         Field4,
  236.         Field5,
  237.         Field6;
  238.     };
  239.  
  240. extern struct pic_data
  241.    {
  242.     struct field_data N,
  243.                       S,
  244.                       E,
  245.                       W;
  246.    
  247.  
  248.    }roomrec[250];
  249.  
  250.  
  251.  
  252. #define max_x 27     /* o to 24  = 25 rooms*/
  253. #define max_y 27      /* 0 to 25   = 26 rooms */ 
  254.  
  255. extern struct stuff
  256.        {
  257.        int room;
  258.        int n,s,e,w;
  259.        };
  260.  
  261.        /* if more rooms added make this bigger!!!! (max x and y )*/ 
  262.        /* map[][] uses map[0][0] to map[maxx][maxy] all other arrays
  263.           starts at array[1] */
  264. extern struct stuff map[max_y][max_x];     /* 2 d array in c is in form a[y][x] */
  265.  
  266. extern int sound;  /* to turn sound on/off, default is ON */
  267.